<extend name="./public/frame.html"/>
<block name="content">
	<blockquote class="layui-elem-quote search">
		<div class="layui-inline">
			<select id="all_order" name="all_order" class="layui-input" style="width: 90px;">
				<option value="">司机检索</option>
				<option value="1">普通司机</option>
				<option value="2">测试司机</option>
			</select>
		</div>
		<div class="layui-input-inline">
			<div class="layui-inline">
				<input type="text" class="layui-input date" id="start_time" name="start_time" value="<?php echo $dateArray['start_time'];?>" placeholder="开始日期" style="width: 150px;">
			</div>
			<div class="layui-inline">
				<input type="text" class="layui-input date" id="end_time" name="end_time" value="<?php echo $dateArray['end_time'];?>" placeholder="结束日期" style="width: 150px;">
			</div>
		</div>
		<div class="layui-inline">
			<input type="text" name="driver_phone" lay-verify="required|title" required placeholder="请输入手机号" class="layui-input" id="driver_phone">
		</div>
		<div class="layui-inline">
			<select name="rank" id="rank" class="layui-input" lay-filter="rank" style="width: 120px;">
				<option value="">排名</option>
				<option value="1">接单数量</option>
				<option value="2">接单时间</option>
				<option value="3">完成订单</option>
				<option value="4">待结算订单</option>
				<option value="5">接单总额</option>
				<option value="6">正常订单</option>
				<option value="7">异常订单</option>
				<option value="8">累计时长</option>
				<option value="9">司机评分</option>
			</select>
		</div>
		<div class="layui-inline">
			<button class="layui-btn" data-type="search">搜索</button>&nbsp;&nbsp;
			（<span style="color: green;">当日数据排行榜</span>&nbsp;&nbsp;注：<span style="color: red;">接单时间 - 9999999 代表没有接过单</span>）
		</div>
	</blockquote>
	<table class="layui-table" lay-data="{width:'auto', height:'auto', url:'{:url('FastCar/driver')}', page: true, limit: 10, id:'FastCar'}" lay-filter="FastCar">
		<thead>
		<tr>
			<th lay-data="{field:'top', width:80,fixed: true,align:'center'}">排名</th>
			<th lay-data="{field:'driver_id', width:100,align:'center'}">Driver_id</th>
			<th lay-data="{field:'driver_name', width:100,align:'center'}">姓名</th>
			<th lay-data="{field:'driver_phone', width:120,align:'center'}">手机号</th>
			<th lay-data="{field:'catchOrderNum', width:120,align:'center'}">接单数量</th>
			<th lay-data="{field:'catchOrderTime', width:150,align:'center'}">接单时间（秒）</th>
			<th lay-data="{field:'finishOrderNum', width:120,align:'center'}">完成订单数量</th>
			<th lay-data="{field:'waitOrderNum', width:120,align:'center'}">待结算订单</th>
			<th lay-data="{field:'finishOrderMoney', width:120,align:'center'}">完成订单总额</th>
			<th lay-data="{field:'allNormalCount', width:120,align:'center'}">正常订单</th>
			<th lay-data="{field:'allAbnormalCount', width:120,align:'center'}">异常订单</th>
			<th lay-data="{field:'sumOnlineTime', width:150,align:'center'}">累计在线时长</th>
			<th lay-data="{field:'score', width:100,align:'center'}">司机评分</th>
			<!--<th lay-data="{fixed:'right', toolbar: '#barDemo', width:150, align:'center'}">操作</th>-->
		</tr>
		</thead>
	</table>
	<script type="text/html" id="barDemo">
		<!--<a class="layui-btn layui-btn-xs layui-btn-warm" lay-event="look" style="width: 50px">查看</a>-->
	</script>
	<script>
		layui.use(['form','table','laydate'], function () {
			var table = layui.table,form = layui.form,laydate = layui.laydate;
			lay('.date').each(function(){
				laydate.render({
					elem: this
					,type: 'date'
					,trigger: 'click'
				});
			});
			table.on('tool(FastCar)', function (obj) {
				var data = obj.data;
				var uid = data.uid;
				if (obj.event === 'look') {
					layer.msg('正在开发中,敬请期待');return false;
					layer.open({
						type: 2,
						title: '查看积分明细',
						shadeClose: true,
						shade: 0.8,
						area: ['100%', '100%'],
						content: '{:url("/admin/UserIntegral/look","uid=")}' + uid //iframe的url
					});
				}
			});
			//搜索
			$('.layui-btn').on('click', function () {
				var driver_phone 	= $("#driver_phone").val();
				var rank			= $("#rank").val();
				var rank			= $("#rank").val();
				var start_time		= $("#start_time").val();
				var end_time		= $("#end_time").val();
				var all_order		= $("#all_order").val();
				table.reload('FastCar', {
					url: '/admin/FastCar/driver', where: {
						"driver_phone": driver_phone,
						"rank": rank,
						"start_time": start_time,
						"end_time": end_time,
						"all_order": all_order,
					}
				});
			});
		});
	</script>
</block>
